﻿using Clothes.BLL;
using Clothes.Comment;
using Clothes.IBLL;
using System;
using System.Collections.Generic;
using System.Linq;
using System.Web;
using System.Web.UI;
using System.Web.UI.WebControls;

namespace YongHu_UI
{
    public partial class register : System.Web.UI.Page
    {
        protected void Page_Load(object sender, EventArgs e)
        {

        }

        protected void Button1_Click(object sender, EventArgs e)
        {
            if (Page.IsValid)
            {
                if (Session["code"].Equals(txt_yan.Text))
                {
                    CLLoginIBLL cLLogin = new CLLoginBLL();
                    OperResult a = cLLogin.Register(UserName.Text, MobileNumber.Text, Password.Text, Convert.ToInt32(DropDownList1.SelectedValue));
                    if (a.Status == true)
                    {
                        Response.Redirect("login.aspx");
                    }
                    else
                    {
                        ClientScript.RegisterStartupScript(GetType(), "loginerror", $"alert('{a.Massage}')", true);
                    }
                }
            }
        }
    }
}